<#assign basePath = request.contextPath >
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Basic DataGrid - jQuery EasyUI Demo</title>
   	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${basePath}/resources/easyui/themes/icon.css">
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="${basePath}/resources/easyui/jquery.easyui.min.js"></script>
</head>
<body>
	<div style="padding:5px;background:#fafafa;border:1px solid #ccc">
	    <a target="_blank" href="https://api.weibo.com/oauth2/authorize?client_id=1434805718&redirect_uri=https://api.weibo.com/oauth2/default.html&response_type=code"  class="easyui-linkbutton" plain="true" iconCls="icon-ok" id="oauth">检查登录状态</a>
	</div>
	<div style="margin-top:10px;">
   		<input name="code" class="f1 easyui-textbox"></input>
   		<a href="##" id="submit">更新授权信息</a>
   	</div>
</body>
<script type="text/javascript">
$(function(){
	$("#submit").click(function(){
		var code = $("input[name='code']").val();
		if(!code){
			alert("授权码不能为空");
			return;
		}
		$.ajax({
			url: '${basePath}/sina/oauth.json',
			data:{
				code : code
			},
			success: function(data){
			}
		});
		
	});
});
</script>
</html>